<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <link rel="stylesheet" href="./boom.css" />
  </head>
  <body>
    <div class="back">
      <iframe src="http://192.168.46.150:8080/Demo/" frameborder="0"></iframe>
    </div>
    <div style="position: relative; top: 5%; left: 2%;height: 290px;width: 450px;border: 1px solid #20558b;">
      <img src="./img/bj-1.png" alt="" class="bj-1" />
      <img src="./img/bj-2.png" alt="" class="bj-2" />
      <img src="./img/bj-3.png" alt="" class="bj-3" />
      <img src="./img/bj-4.png" alt="" class="bj-4" />
      <div id="kernelsNumber"></div>
      <div id="coreNumber"></div>
      <div id="ip"></div>
      <div id="systemName"></div>
      <div id="operatingSystem"></div>
      <div id="kernelVersion"></div>
    </div>

    <script>
      let xhr = new XMLHttpRequest();
      //2. 与服务器建立连接
      xhr.open(
        "get",
        "http://192.168.46.216:8091/jeecg-boot/deviceInfo/selectAll",
        true
      );
      //3. 注册事件
      xhr.onload = function () {
        let data = JSON.parse(xhr.responseText);
        data = data.result[1];
        let kernelsNumber = document.getElementById("kernelsNumber");
        let coreNumber = document.getElementById("coreNumber");
        let ip = document.getElementById("ip");
        let systemName = document.getElementById("systemName");
        let operatingSystem = document.getElementById("operatingSystem");
        let kernelVersion = document.getElementById("kernelVersion");
        kernelsNumber.innerText = data.kernelsNumber;
        coreNumber.innerText = data.coreNumber;
        ip.innerText = data.ip;
        systemName.innerText = data.systemName;
        operatingSystem.innerText = data.operatingSystem;
        kernelVersion.innerText = data.kernelVersion;
      };
      //4. 发送请求
      xhr.send();
    </script>
  </body>
</html>
